﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gammar.Digger.SystemFramework
{
    public enum StringStyle
    {
        highlight, subdued, error, success, caption
    }

    public class StringHelper
    {
        public static long DateTimeToLong(DateTime dateTime)
        {
            return dateTime.Ticks;
        }

        public static DateTime LongToDateTime(long dateTime)
        {
            return new DateTime(dateTime);
        }


        public static string FormatString(string sourceString, StringStyle format)
        {
            string html = @"<div class='{0}'>{1}<div>";
            return string.Format(html, format.ToString(), sourceString);
        }

        public static bool IsInt(string str)
        {
            if (string.IsNullOrEmpty(str))
            {
                return false;
            }
            else
            {
                int value = int.MinValue;
                bool isInt = int.TryParse(str, out value);
                return isInt;
            }
        }
    }
}
